import { createStore } from 'redux'
import { actionType, stateType } from '../interface'

const reducer = (state:any, action: actionType) => {
    const { type } = action
    if (type === 'CHANGE_USER_INFO') {
       return {
           ...state,
           userInfo: action.data
       } 
    }
    console.log(state)
    return state
}

const initalState:stateType | any = {
    userInfo: {}
}

const store = createStore(reducer, initalState)

export default store